package com.dede.getmusic.data;

import java.util.List;

/**
 * @author hsh
 * @date 2017/9/29 16:54.
 * @doc
 */
public class SearchInfo {

    /**
     * queryCorrected : ["相约九八"]
     * songs : [{"id":115502,"name":"红日","artists":[{"id":3699,"name":"李克勤","picUrl":null,"alias":[],"albumSize":0,"picId":0,"img1v1Url":"http://p1.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0,"trans":null}],"album":{"id":11307,"name":"红日","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"img1v1Url":"http://p1.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0,"trans":null},"publishTime":694195200004,"size":11,"copyrightId":5003,"status":1,"picId":18612532836965764},"duration":287173,"copyrightId":7003,"status":0,"alias":["电视剧《他来自天堂》主题曲"],"rtype":0,"ftype":0,"mvid":5308823,"fee":8,"rUrl":null}]
     * songCount : 600
     */

    private int songCount;
    private List<SongsBean> songs;

    public int getSongCount() {
        return songCount;
    }

    public void setSongCount(int songCount) {
        this.songCount = songCount;
    }

    public List<SongsBean> getSongs() {
        return songs;
    }

    public void setSongs(List<SongsBean> songs) {
        this.songs = songs;
    }

    public static class SongsBean {

        @Override
        public String toString() {
            return getArtistsName() + " - " + this.name;
        }

        public String getArtistsName() {
            String artistStr = "";
            for (ArtistsBean artist : artists) {
                artistStr += (artist.name + "/");
            }
            if (!artists.isEmpty()) {
                artistStr = artistStr.substring(0, artistStr.length() - 1);
            }
            return artistStr;
        }

        /**
         * id : 115502
         * name : 红日
         * artists : [{"id":3699,"name":"李克勤","picUrl":null,"alias":[],"albumSize":0,"picId":0,"img1v1Url":"http://p1.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0,"trans":null}]
         * album : {"id":11307,"name":"红日","artist":{"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"img1v1Url":"http://p1.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0,"trans":null},"publishTime":694195200004,"size":11,"copyrightId":5003,"status":1,"picId":18612532836965764}
         * duration : 287173
         * copyrightId : 7003
         * status : 0
         * alias : ["电视剧《他来自天堂》主题曲"]
         * rtype : 0
         * ftype : 0
         * mvid : 5308823
         * fee : 8
         * rUrl : null
         */

        private int id;
        private String name;
        private AlbumBean album;
        private int duration;
        private int mvid;
        private List<ArtistsBean> artists;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public AlbumBean getAlbum() {
            return album;
        }

        public void setAlbum(AlbumBean album) {
            this.album = album;
        }

        public int getDuration() {
            return duration;
        }

        public void setDuration(int duration) {
            this.duration = duration;
        }

        public int getMvid() {
            return mvid;
        }

        public void setMvid(int mvid) {
            this.mvid = mvid;
        }

        public List<ArtistsBean> getArtists() {
            return artists;
        }

        public void setArtists(List<ArtistsBean> artists) {
            this.artists = artists;
        }

        public static class AlbumBean {
            /**
             * id : 11307
             * name : 红日
             * artist : {"id":0,"name":"","picUrl":null,"alias":[],"albumSize":0,"picId":0,"img1v1Url":"http://p1.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg","img1v1":0,"trans":null}
             * publishTime : 694195200004
             * size : 11
             * copyrightId : 5003
             * status : 1
             * picId : 18612532836965764
             */

            private int id;
            private String name;

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

        }

        public static class ArtistsBean {
            /**
             * id : 3699
             * name : 李克勤
             * picUrl : null
             * alias : []
             * albumSize : 0
             * picId : 0
             * img1v1Url : http://p1.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg
             * img1v1 : 0
             * trans : null
             */

            private int id;
            private String name;

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

        }
    }
}
